#include <iostream>
#include <zlib/eventsystem/I_Thread.h>
#include <unistd.h>
#include <zlib/eventsystem/I_Lock.h>

using namespace std;

void *test(void *arg)
{
	cout << "test" << endl;
	cout << this_thread() << endl;
	cout << this_thread()->mutex_ptr << endl;

	MUTEX_TRY_LOCK(l, this_thread()->mutex_ptr, new EThread(1));
	if(l.is_locked())
	{
		cout << "lock success" << endl;
	}else{
		cout << "lock faild" << endl;
	}
}

int main()
{
	Thread t;
	cout << &t << endl;
	t.start("ET_TEST", test, NULL, 1);

	sleep(10);

	return 0;
}
